With the continuous improvement of graphics processor performance, the demand for bandwidth and memory capacity also increases. Currently, the use of bandwidth can be reduced through: First, using offline tools to perform lossy compression on texture data, that is, using compression format such as DXT, ETC, ASTC, PVRTC to compress texture data; Second, after the data is processed, performing lossless compression on data such as depth, template or shading target.
Please refer to FIG. 1, which is a block view of a graphic data compression device in prior art. As shown in FIG. 1, the graphic data compression device 10 in prior art includes a processing unit 11, a memory interface unit 13, a memory 15 and a display unit 17. The memory interface unit 13 includes a lossless compression module 131 and a decompression module 133. During the graphic data processing, the processing unit 11 first reads, through the memory interface unit 13, the resource data needed for shading, such as texture data, vertex data, index data, etc. After the processing is completed, the lossless compression module 131 perform a lossless compression on the shading target data in the processed data and then the memory interface unit 13 writes the processed and compressed data into the memory 15. Then, if the compressed data needs a further processing, such as the post-processing of depth of field (DOF), high dynamic range (HDR) or deferred shading, the decompression module 133 reads the data in need of post-processing from the memory 15 and decompresses the data. Then, the decompressed data is provided to the processing unit 11 for post-processing. Similarly, the lossless compression module 131 perform a lossless compression on the data having a post-processing by the processing unit 11 and then the memory interface unit 13 writes the compressed data into the memory 15. Then, the decompression module 133 or a decompression module (not shown) of the display unit 17 reads the finally-processed data from the memory 15 for data decompression and then provides the decompressed data to the display unit 17 for graphic displaying on a screen.
By performing the above-described compression, the demand for bandwidth for data processing is effectively reduced. However, in order to avoid compression failure, the memory 15 needs to allocate a fixed area to store the compressed data; wherein the storage space of the fixed area is usually not smaller than the size of the data before compression. That is, even the processed data is compressed, the storage space in the memory 15 for the compressed data is still not smaller than the size of the data before compression. Therefore, the above-described compression can reduce bandwidth load only, but is unable to reduce the usage of storage space in the memory 15. Further, for high-resolution screen such as the popular 4K screen, the required capacity of the memory cannot be reduced, thus hindering the reduction in cost of the memory.